#include <utility>
#include <ctime>
#include "Stopper.h"


/* TimeUnit::_unitNameAndValue
		constant that holds information about the names and values of the various time units. 
		The values of the various time units are relative to COMPUTER_TIME.	*/
const pair<const char*, clock_t> TimeUnit::_unitNameAndValue[3] = {
	make_pair("Sec", CLOCKS_PER_SEC),
	make_pair("MiliSec", CLOCKS_PER_SEC/1000),
	make_pair("CT", 1)
};


inline double Stopper::getTime(TimeUnit unit = TimeUnit::COMPUTER_TIME, bool fractions = true) const{
	if(_fractionFlg) {
		return (clock() - _time0) / (double)unit.value();
	}else {
		return (clock() - _time0) / unit.value();
	}
}

